package com.atguigu.gulimall.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author 孤风雪影
 * @date 2021/2/17 18:27
 */

@Slf4j
@Component
public class HelloSchedule {

    /**
     * 1.定时任务默认是阻塞的
     * 2.搭配spring的异步任务
     * 测试定时任务
     */
    @Async
    @Scheduled(cron = "* * * * * ?")
    public void hello() {
        log.info("hello...");
    }

}
